<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <script src="../public/lobster/js/public.js"></script>
    <link rel="stylesheet" type="text/css" href="../public/lobster/icon/iconfont.css">
    <link rel="stylesheet" href="../public/lobster/css/public.css">
    <link rel="stylesheet" href="../public/lobster/css/shared.css">
    <link rel="stylesheet" href="../public/lobster/css/href.css?2170402">
    <script src="../public/lobster/js/lick.js"></script>
    <script src="../public/lobster/js/click.js"></script>
    <title>提货单</title>
</head>
<body class="pick">
    <div class="pickup">
        <div class="pickone">
            <h1>商品名称：</h1>
            <p>竹炭牙刷1支</p>
            <div>
                <h2>购买数量： <span>1</span></h2>
                <h2>运费： <span id="money">10.0</span></h2>
            </div>
        </div>
         
               
        <div class="picktwo">
            <h3>收货信息：</h3>
            <form>
                <label for="username">姓名：</label>
                <input type="text" name="username" id="username" class="enters" value="林生"/>
                <h4></h4>
                <label for="phone">电话：</label>
                <input type="text" name="phone" id="phone" class="enters" value="13268131797"/>
                <h4></h4>
                <label for="address" class="textarea">地址：</label>
                <textarea name="address" id="address" class="enters">广东省广州市天河区棠德南路祥盛广场1109室</textarea>
                <h4></h4>
            </form>
            
            <button onclick="enterPickUp('81251a2fdb7b4b94bcb929a3e7b8da12','10.0','2.0')"></button>
            <div class="return">
                <a href="depot.html"></a>
            </div>
        </div>
        
        
        
    </div>
    <br/><br/><br/><br/>
   
    <div class="href">
      	    <a href="lotteryInfo.html">
      	    	榜
      	    </a> 
        	<a href="center.html">
				<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1493966935986" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3765" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M632.855273 565.992727c101.771636-47.080727 172.590545-149.317818 172.590545-267.869091 0-163.118545-133.678545-295.842909-298.007273-295.842909C343.202909 2.280727 209.454545 135.005091 209.454545 298.077091c0 118.597818 70.842182 220.834909 172.590545 267.915636C188.020364 622.336 44.311273 805.329455 38.469818 1024l46.615273 0 844.753455 0 46.638545 0C970.612364 805.329455 826.926545 622.336 632.855273 565.992727z" p-id="3766"></path></svg>
        	</a>
        	<a href="index.html" class="iconfont icon-zhuye1"></a>
       </div>
    
    
</body>
<script src="../public/lobster/js/jq-2.1.0.js"></script>
<script>
	function enterPickUp(depotId,freight,chargeMoney){
		var username = $('#username').val();
		var phone = $('#phone').val();
		var address = $('#address').val();
		var reg = /^0?1[3|4|5|7|8][0-9]\d{8}$/;
		if(username.length < 1){
			//alert('姓名不能为空');
			xxone.popup("提示","姓名不能为空","确认");
			return;
		}
		if(phone.length<1){
			//alert('电话不能为空');
			xxone.popup("提示","电话不能为空","确认");
			return;
		}
		if (!reg.test(phone)){
			//funll('phone','手机号格式错误');
			//alert('手机号格式错误');
			xxone.popup("提示","手机号格式错误","确认");
			return;
		}
		
		if(address.length < 1){
			//alert('地址不能为空');
			xxone.popup("提示","地址不能为空","确认");
			return;
		}
		
		xxy.popup("提示","运费首件"+freight+"元,此后每件依次加"+chargeMoney+"元,您本次需要支付运费:"+$("#money").html()+"元","确认","取消");
		$('#xxy-popup-done').bind('click',function(){
			$.ajax({
	    		type:"POST",
	    		url: "/user/enterPickUP?v="+Math.random(),
	    		data:{
	    			depotId : depotId,
	    			username : username,
	    			phone : phone,
	    			address : address
	    		},
	    		dataType:"json",
	    		success:function(data){
	    			if(data.success){
	    				window.location.href='depot.html';
	    			}else{
	    				//alert(data.msg);
	    				xxone.popup("提示",data.msg,"确认");
	    				$('#xxone-popup-done').bind('click',function(){
	    					if(data.msg == '账户余额不足，请充值'){
	    						window.location.href='recharge.html';
	    					}else{
	        					window.location.reload();
	    					}
	    				  });
	    			}
	    		}	
	    		
	    	});
			
		});
		
		
	}
</script>
</html>